// ==UserScript==
// @name         test - exportExcelDataImage
// @namespace    http://tako.tampermonkey.net/
// @version      0.1
// @description  exportExcelDataImage
// @author       tako
// @match        *://*/*
// @run-at       context-menu
// @grant        GM_xmlhttpRequest
// @require      https://cdn.jsdelivr.net/npm/exceljs@4.3.0/dist/exceljs.min.js
// @require      https://cdn.jsdelivr.net/npm/file-saver@2.0.5/dist/FileSaver.min.js
// ==/UserScript==
(function () {
  'use strict';

  let data = [
    {
      "no": 0,
      "sku": "DFG454",
      "image": "https://img.kwcdn.com/product/open/3c50e288d8d34ab388293e07f7fd6965-goods.jpeg",
      "color": "黑色-M(1);",
      "total": 1
    },
    {
      "no": 1,
      "sku": "DCG1156",
      "image": "https://img.kwcdn.com/product/open/45552c814c854550b2b5feca7dd8d9d2-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 2,
      "sku": "DCG1343",
      "image": "https://img.kwcdn.com/product/fancy/2f560f2c-5a7a-4d81-a2c6-18a2ed2036b0.jpg",
      "color": "黑色-S(1);",
      "total": 1
    },
    {
      "no": 3,
      "sku": "DCG646",
      "image": "https://img.kwcdn.com/product/fancy/c5d63189-0f67-45d5-9788-e7e061610c7d.jpg",
      "color": "白色-L(1);白色-XL(1);",
      "total": 2
    },
    {
      "no": 4,
      "sku": "DCG1196",
      "image": "https://img.kwcdn.com/product/open/3b1225a25e2c4e618cfe5897ee6b6038-goods.jpeg",
      "color": "白色-S(1);",
      "total": 1
    },
    {
      "no": 5,
      "sku": "DCG1018",
      "image": "https://img.kwcdn.com/product/fancy/f04a4102-2053-4caf-a0ec-12cc571f981f.jpg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 6,
      "sku": "DCG1018",
      "image": "https://img.kwcdn.com/product/fancy/f04a4102-2053-4caf-a0ec-12cc571f981f.jpg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 7,
      "sku": "DFG1100-1",
      "image": "https://img.kwcdn.com/product/fancy/4ede7961-d340-417f-9a7e-f9a0666a7d1c.jpg",
      "color": "白色-XL(1);",
      "total": 1
    },
    {
      "no": 8,
      "sku": "DCG1428",
      "image": "https://img.kwcdn.com/product/fancy/f9798a1a-9bf9-40fa-a714-d47638db244c.jpg",
      "color": "白色-XL(2);",
      "total": 2
    },
    {
      "no": 9,
      "sku": "DFG253",
      "image": "https://img.kwcdn.com/product/open/6eb18765eb3c4ac1b6bec10b423b0cea-goods.jpeg",
      "color": "黑色-L(2);黑色-XXL(1);",
      "total": 3
    },
    {
      "no": 10,
      "sku": "DCG595",
      "image": "https://img.kwcdn.com/product/open/b553b2e5bc764ef1a8065973dc72099c-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 11,
      "sku": "DCG1161",
      "image": "https://img.kwcdn.com/product/open/ff346b507cf5440694caeeb418d3c293-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 12,
      "sku": "DCG1161",
      "image": "https://img.kwcdn.com/product/open/ff346b507cf5440694caeeb418d3c293-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 13,
      "sku": "DFG496",
      "image": "https://img.kwcdn.com/product/open/bdb97e2f477241c6bfd6b8e3153fdc7d-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 14,
      "sku": "DCG1206",
      "image": "https://img.kwcdn.com/product/open/f84ca8b2dc4c4637920fafb7d3a236d6-goods.jpeg",
      "color": "黑色-XL(2);",
      "total": 2
    },
    {
      "no": 15,
      "sku": "DCG1150",
      "image": "https://img.kwcdn.com/product/open/d918214cbb0d4910b26c5930112dfa0e-goods.jpeg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 16,
      "sku": "LXCG114",
      "image": "https://img.kwcdn.com/product/open/31c531b2d23646628658a7d697f63c23-goods.jpeg",
      "color": "白色-XXL(1);",
      "total": 1
    },
    {
      "no": 17,
      "sku": "LXCG1398",
      "image": "https://img.kwcdn.com/product/open/38249172e3a147dd96254abb4b2de6f9-goods.jpeg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 18,
      "sku": "LC361",
      "image": "https://img.kwcdn.com/product/open/0cada0b5b2dd4c929db0b6e0cf6177d1-goods.jpeg",
      "color": "黑色-M(1);",
      "total": 1
    },
    {
      "no": 19,
      "sku": "DFG902",
      "image": "https://img.kwcdn.com/product/open/9a58556bc1fc45928788175203c59406-goods.jpeg",
      "color": "白色-S(1);",
      "total": 1
    },
    {
      "no": 20,
      "sku": "DFG902",
      "image": "https://img.kwcdn.com/product/open/9a58556bc1fc45928788175203c59406-goods.jpeg",
      "color": "白色-S(1);白色-M(1);白色-L(1);",
      "total": 3
    },
    {
      "no": 21,
      "sku": "DGXC1721",
      "image": "https://img.kwcdn.com/product/open/929b6190f48e49b3bfb5fda2b33373a3-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 22,
      "sku": "DCG1134-1",
      "image": "https://img.kwcdn.com/product/open/63dd1eb35e02485a8cf972aee8732ad1-goods.jpeg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 23,
      "sku": "DCG1360",
      "image": "https://img.kwcdn.com/product/open/e3a27aaa44554f6db565c56cc7760d50-goods.jpeg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 24,
      "sku": "DFG838",
      "image": "https://img.kwcdn.com/product/fancy/7fcf2cd5-9c5f-435d-905f-1abf1180e6be.jpg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 25,
      "sku": "DCG1344",
      "image": "https://img.kwcdn.com/product/open/e605973879384df282712e9f473efda0-goods.jpeg",
      "color": "黑色-L(1);黑色-XL(1);",
      "total": 2
    },
    {
      "no": 26,
      "sku": "DCG1344",
      "image": "https://img.kwcdn.com/product/open/e605973879384df282712e9f473efda0-goods.jpeg",
      "color": "黑色-L(1);黑色-XL(1);",
      "total": 2
    },
    {
      "no": 27,
      "sku": "LXCG735",
      "image": "https://img.kwcdn.com/product/open/d89bf6c7109e490687ecc7399a0949a6-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 28,
      "sku": "LXCG735",
      "image": "https://img.kwcdn.com/product/open/d89bf6c7109e490687ecc7399a0949a6-goods.jpeg",
      "color": "白色-S(1);",
      "total": 1
    },
    {
      "no": 29,
      "sku": "DJG056",
      "image": "https://img.kwcdn.com/product/fancy/ac52ae15-cec8-4f4f-9d4d-a7b7459543a8.jpg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 30,
      "sku": "LXCG801",
      "image": "https://img.kwcdn.com/product/open/9688ed6dfee04c3e9bf450afb7301e38-goods.jpeg",
      "color": "白色-S(1);白色-L(1);",
      "total": 2
    },
    {
      "no": 31,
      "sku": "DCG1365",
      "image": "https://img.kwcdn.com/product/open/3f55b40f046243d791ca1d509d5af53a-goods.jpeg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 32,
      "sku": "DCG1365",
      "image": "https://img.kwcdn.com/product/open/3f55b40f046243d791ca1d509d5af53a-goods.jpeg",
      "color": "黑色-M(1);",
      "total": 1
    },
    {
      "no": 33,
      "sku": "DCG787",
      "image": "https://img.kwcdn.com/product/open/d3f0ce42f2eb4c6f93be8b2e2f01ae00-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 34,
      "sku": "DCG1404",
      "image": "https://img.kwcdn.com/product/open/c4be764b113e471db0ff557dd9f4ddc3-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 35,
      "sku": "DCG1399",
      "image": "https://img.kwcdn.com/product/fancy/7d3a1344-82b8-4c0f-8d68-f91570db0651.jpg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 36,
      "sku": "DCG1034",
      "image": "https://img.kwcdn.com/product/fancy/b7a169db-0e9c-424e-95d2-ffbc9d489674.jpg",
      "color": "黑色-M(1);",
      "total": 1
    },
    {
      "no": 37,
      "sku": "LXCG920",
      "image": "https://img.kwcdn.com/product/open/93fa58ad33b74942bcb7febfa42a95d3-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 38,
      "sku": "DCG975",
      "image": "https://img.kwcdn.com/product/open/5183a58aae7d46f080f1982cc5ede9a2-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 39,
      "sku": "DCG1197",
      "image": "https://img.kwcdn.com/product/open/9e6964e7eab84765a209f35a27fa8c61-goods.jpeg",
      "color": "白色-M(4);白色-L(6);白色-XL(2);白色-XXL(1);",
      "total": 13
    },
    {
      "no": 40,
      "sku": "DCG1028",
      "image": "https://img.kwcdn.com/product/fancy/b5f3f84d-13b2-4255-8bae-e5b6bd6357b1.jpg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 41,
      "sku": "DCG1028",
      "image": "https://img.kwcdn.com/product/fancy/b5f3f84d-13b2-4255-8bae-e5b6bd6357b1.jpg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 42,
      "sku": "DCG1418",
      "image": "https://img.kwcdn.com/product/open/062a494da3964169aac26d768f4de061-goods.jpeg",
      "color": "黑色-M(1);黑色-XL(1);黑色-XXL(1);",
      "total": 3
    },
    {
      "no": 43,
      "sku": "DCG1418",
      "image": "https://img.kwcdn.com/product/open/062a494da3964169aac26d768f4de061-goods.jpeg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 44,
      "sku": "DCG941",
      "image": "https://img.kwcdn.com/product/open/1bbe6ae5bba5458a89a69210df3849eb-goods.jpeg",
      "color": "白色-S(1);",
      "total": 1
    },
    {
      "no": 45,
      "sku": "DCG1218",
      "image": "https://img.kwcdn.com/product/open/d0854ddbd05744f2a6e67925481fdfc9-goods.jpeg",
      "color": "黑色-M(1);黑色-XXL(1);",
      "total": 2
    },
    {
      "no": 46,
      "sku": "LXCG407",
      "image": "https://img.kwcdn.com/product/open/7762ae120f8b492692dfa0b2c703c519-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 47,
      "sku": "DCG1192",
      "image": "https://img.kwcdn.com/product/fancy/0c4776d4-87bb-487e-b670-bb37f405d3fc.jpg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 48,
      "sku": "DCG1192",
      "image": "https://img.kwcdn.com/product/fancy/0c4776d4-87bb-487e-b670-bb37f405d3fc.jpg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 49,
      "sku": "DFG465",
      "image": "https://img.kwcdn.com/product/fancy/e6fd4734-3fc4-4703-ba3d-5862792ca810.jpg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 50,
      "sku": "DCG1368",
      "image": "https://img.kwcdn.com/product/fancy/4eb9c52e-4c01-42aa-a8ad-025c835cbbf9.jpg",
      "color": "白色-XXL(1);",
      "total": 1
    },
    {
      "no": 51,
      "sku": "DCG1221",
      "image": "https://img.kwcdn.com/product/fancy/ff3f1e52-3e1b-4bde-82c6-62bb01fb3981.jpg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 52,
      "sku": "DCG1221",
      "image": "https://img.kwcdn.com/product/fancy/ff3f1e52-3e1b-4bde-82c6-62bb01fb3981.jpg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 53,
      "sku": "DJG003",
      "image": "https://img.kwcdn.com/product/fancy/b65eee57-bb37-400e-a229-22e4b363e494.jpg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 54,
      "sku": "DFG325",
      "image": "https://img.kwcdn.com/product/fancy/1dc11e6a-cff5-4e51-90e4-656825253d64.jpg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 55,
      "sku": "DF223",
      "image": "https://img.kwcdn.com/product/open/579e849ab191453bbba5cb259a96234f-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 56,
      "sku": "DCG1419",
      "image": "https://img.kwcdn.com/product/open/638fa282bba44465ad33a4a953e583be-goods.jpeg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 57,
      "sku": "DFG694",
      "image": "https://img.kwcdn.com/product/open/cbb4af8d35bf46e6a3cb25dc0a347f94-goods.jpeg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 58,
      "sku": "DJG006",
      "image": "https://img.kwcdn.com/product/fancy/c2763f5f-8a7f-4b4f-b267-197956d3bbbe.jpg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 59,
      "sku": "DF814",
      "image": "https://img.kwcdn.com/product/open/c39558690c4141e3a3c938f0d33c96fc-goods.jpeg",
      "color": "白色-XXL(1);",
      "total": 1
    },
    {
      "no": 60,
      "sku": "DCG1072",
      "image": "https://img.kwcdn.com/product/open/e406c7cd540d4efcacfb0086b2f2891f-goods.jpeg",
      "color": "白色-S(1);",
      "total": 1
    },
    {
      "no": 61,
      "sku": "DCG590",
      "image": "https://img.kwcdn.com/product/fancy/f81546d0-7bcd-40c5-bd38-1c16d7a9efca.jpg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 62,
      "sku": "DCG677",
      "image": "https://img.kwcdn.com/product/open/8ed9a4179b464f9a8df4c2e20ce44b15-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 63,
      "sku": "DCG1579",
      "image": "https://img.kwcdn.com/product/fancy/07e762fa-1f73-49a8-be3e-381a2717f6f4.jpg",
      "color": "白色-XXL(1);",
      "total": 1
    },
    {
      "no": 64,
      "sku": "DJG047",
      "image": "https://img.kwcdn.com/product/fancy/a9addf43-2a41-4961-ae9c-ea73405a9d34.jpg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 65,
      "sku": "DCG735",
      "image": "https://img.kwcdn.com/product/fancy/81d9d90d-ce60-4b4a-968d-6eeccc587742.jpg",
      "color": "白色-XXL(1);",
      "total": 1
    },
    {
      "no": 66,
      "sku": "DCG949",
      "image": "https://img.kwcdn.com/product/fancy/83a0f4e2-77cf-4d75-b525-2d3bb54056e6.jpg",
      "color": "白色-XXL(1);",
      "total": 1
    },
    {
      "no": 67,
      "sku": "DFG595",
      "image": "https://img.kwcdn.com/product/fancy/13ccaa96-1b27-434d-bed4-f1c7f46fb5e0.jpg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 68,
      "sku": "LXGXC1033",
      "image": "https://img.kwcdn.com/product/open/8251041681104aa78e642e7d72500a20-goods.jpeg",
      "color": "黑色-S(1);",
      "total": 1
    },
    {
      "no": 69,
      "sku": "LXGXC1033",
      "image": "https://img.kwcdn.com/product/open/8251041681104aa78e642e7d72500a20-goods.jpeg",
      "color": "黑色-S(4);黑色-M(4);黑色-L(2);",
      "total": 10
    },
    {
      "no": 70,
      "sku": "DCG1204",
      "image": "https://img.kwcdn.com/product/open/776e8b5dd3364d56b7594aea31517b6f-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 71,
      "sku": "YDGXC1221",
      "image": "https://img.kwcdn.com/product/open/a61e0b4ad6df47d68a02eee2deeacab6-goods.jpeg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 72,
      "sku": "DFG283",
      "image": "https://img.kwcdn.com/product/open/4f06776b63b44c07baf77d0616711060-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 73,
      "sku": "DFG458",
      "image": "https://img.kwcdn.com/product/fancy/28ddeb2c-3e99-4463-9d3d-19c23cbd7bd7.jpg",
      "color": "黑色-S(1);",
      "total": 1
    },
    {
      "no": 74,
      "sku": "DCG639",
      "image": "https://img.kwcdn.com/product/fancy/bd4d5bc3-0671-4658-9986-80da1bc6ccb2.jpg",
      "color": "黑色-M(1);黑色-XL(2);",
      "total": 3
    },
    {
      "no": 75,
      "sku": "DCG639",
      "image": "https://img.kwcdn.com/product/fancy/bd4d5bc3-0671-4658-9986-80da1bc6ccb2.jpg",
      "color": "黑色-M(1);",
      "total": 1
    },
    {
      "no": 76,
      "sku": "DFG899",
      "image": "https://img.kwcdn.com/product/open/a03690f28b394b539fe174c97fb6e479-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 77,
      "sku": "DC417",
      "image": "https://img.kwcdn.com/product/open/1c780f7b283c4a1f842c55f1552b85b4-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 78,
      "sku": "DFG374",
      "image": "https://img.kwcdn.com/product/open/4e83dc992ecc497d92039171631e5b8f-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 79,
      "sku": "DFG456",
      "image": "https://img.kwcdn.com/product/open/056da45930e14fe98dbc0697664d0eef-goods.jpeg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 80,
      "sku": "LXC362",
      "image": "https://img.kwcdn.com/product/fancy/c68674f6-38f5-4b6d-aec5-c6334777ac3c.jpg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 81,
      "sku": "DF3211-1",
      "image": "https://img.kwcdn.com/product/fancy/d84eee7e-68f9-4fe4-9e8c-fe3cea141cc1.jpg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 82,
      "sku": "DCG1219",
      "image": "https://img.kwcdn.com/product/open/2b103ddf14d94c85870899f3be7c9e50-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 83,
      "sku": "DCG122",
      "image": "https://img.kwcdn.com/product/fancy/498a9e08-7f7f-44da-8f22-ae0a9bb0a47c.jpg",
      "color": "白色-XL(1);",
      "total": 1
    },
    {
      "no": 84,
      "sku": "YDXF1018",
      "image": "https://img.kwcdn.com/product/open/064eac645485488fbc0d285bd9006273-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 85,
      "sku": "DCG1050",
      "image": "https://img.kwcdn.com/product/open/69998702b8504e5e8c4cdae633f9876e-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 86,
      "sku": "DFG1063",
      "image": "https://img.kwcdn.com/product/open/9da5d5d50e4b4cc09b8f0db327283853-goods.jpeg",
      "color": "白色-L(2);",
      "total": 2
    },
    {
      "no": 87,
      "sku": "DCG1603",
      "image": "https://img.kwcdn.com/product/open/9e79e3286bd04be198dfda879df4eef7-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 88,
      "sku": "LXCG1046",
      "image": "https://img.kwcdn.com/product/open/8cdc9a0b85a443bcbb06d406af77a66e-goods.jpeg",
      "color": "黑色-M(1);",
      "total": 1
    },
    {
      "no": 89,
      "sku": "LXCG1046",
      "image": "https://img.kwcdn.com/product/open/8cdc9a0b85a443bcbb06d406af77a66e-goods.jpeg",
      "color": "黑色-L(1);黑色-XL(1);黑色-XXL(1);",
      "total": 3
    },
    {
      "no": 90,
      "sku": "DFG878",
      "image": "https://img.kwcdn.com/product/open/55fd2766527149a2ac678812fcaa7312-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 91,
      "sku": "DCG1207",
      "image": "https://img.kwcdn.com/product/fancy/4b685203-f634-40e5-86c0-23b4cdb93461.jpg",
      "color": "黑色-S(1);黑色-M(1);黑色-XL(2);",
      "total": 4
    },
    {
      "no": 92,
      "sku": "DCG1046",
      "image": "https://img.kwcdn.com/product/fancy/13b985d6-7360-4d8f-95f7-4d15634dc8a6.jpg",
      "color": "黑色-M(1);",
      "total": 1
    },
    {
      "no": 93,
      "sku": "LXCG1033",
      "image": "https://img.kwcdn.com/product/fancy/c57fe1bd-b7e4-410e-8a3a-46dd88006165.jpg",
      "color": "黑色-S(1);",
      "total": 1
    },
    {
      "no": 94,
      "sku": "LXCG1141",
      "image": "https://img.kwcdn.com/product/open/8c467f99981c40e5975c581e566dfe47-goods.jpeg",
      "color": "白色-XL(1);",
      "total": 1
    },
    {
      "no": 95,
      "sku": "LXFC3292",
      "image": "https://img.kwcdn.com/product/open/38c03e5574434fcf8b1b77d7b929d55c-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 96,
      "sku": "DFG893",
      "image": "https://img.kwcdn.com/product/fancy/8b18b94e-d057-45b5-a833-47d27dba45e7.jpg",
      "color": "白色-S(1);白色-XXL(1);",
      "total": 2
    },
    {
      "no": 97,
      "sku": "DCG1437",
      "image": "https://img.kwcdn.com/product/open/ff5a6cb456804517a5c5d356b64fc87e-goods.jpeg",
      "color": "白色-XL(1);",
      "total": 1
    },
    {
      "no": 98,
      "sku": "LCG661",
      "image": "https://img.kwcdn.com/product/open/e95dfb4420614823b45ab25aef0e789e-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 99,
      "sku": "DCG551",
      "image": "https://img.kwcdn.com/product/fancy/57039687-f8c7-4a26-93e8-d51e19ed7122.jpg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 100,
      "sku": "LC385",
      "image": "https://img.kwcdn.com/product/open/937129e5f0c9477a9b977f0977e2e519-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 101,
      "sku": "DGXC2073",
      "image": "https://img.kwcdn.com/product/open/4217f64807d3440e9a4bbcd2411a27fc-goods.jpeg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 102,
      "sku": "DFG840",
      "image": "https://img.kwcdn.com/product/fancy/2ddd4259-4258-4ca5-b415-e093efce14d2.jpg",
      "color": "黑色-S(1);",
      "total": 1
    },
    {
      "no": 103,
      "sku": "DFG436",
      "image": "https://img.kwcdn.com/product/open/b024c2e35e514154a0f2d1b9d6c71551-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 104,
      "sku": "DJG054",
      "image": "https://img.kwcdn.com/product/fancy/b7d5c36d-83da-48a3-9e83-112c5bb18597.jpg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 105,
      "sku": "DJG125",
      "image": "https://img.kwcdn.com/product/fancy/1bae2feb-e7b2-44bc-8c5a-f9688bd2439c.jpg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 106,
      "sku": "DCG982",
      "image": "https://img.kwcdn.com/product/open/9e3660a3931f44729998475ce7961a67-goods.jpeg",
      "color": "黑色-S(1);黑色-L(1);黑色-XL(1);",
      "total": 3
    },
    {
      "no": 107,
      "sku": "DCG891",
      "image": "https://img.kwcdn.com/product/open/f4c9b27767524cf3b9e5380d618c559d-goods.jpeg",
      "color": "黑色-M(1);黑色-L(1);",
      "total": 2
    },
    {
      "no": 108,
      "sku": "LXCG1305",
      "image": "https://img.kwcdn.com/product/open/2433eb3649ce4ed4884766abbe3148ef-goods.jpeg",
      "color": "白色-M(1);白色-L(2);白色-XL(1);",
      "total": 4
    },
    {
      "no": 109,
      "sku": "DCG1031",
      "image": "https://img.kwcdn.com/product/open/2cbd3df35f89403e8410a655fe8a30b0-goods.jpeg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 110,
      "sku": "LXX2652",
      "image": "https://img.kwcdn.com/product/fancy/a938fc90-2d5e-4941-97ef-b9fcf2b1274c.jpg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 111,
      "sku": "DFG1100-1",
      "image": "https://img.kwcdn.com/product/fancy/4ede7961-d340-417f-9a7e-f9a0666a7d1c.jpg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 112,
      "sku": "DCG1907",
      "image": "https://img.kwcdn.com/product/open/51fadd37484e46ffa92ead41da5802c1-goods.jpeg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 113,
      "sku": "DXC2486",
      "image": "https://img.kwcdn.com/product/open/224e645c85b2469894dd18e76e4fde68-goods.jpeg",
      "color": "黑色-S(2);",
      "total": 2
    },
    {
      "no": 114,
      "sku": "DFG873",
      "image": "https://img.kwcdn.com/product/open/d829f1637bc04579babe2e8dbfedc988-goods.jpeg",
      "color": "黑色-S(1);",
      "total": 1
    },
    {
      "no": 115,
      "sku": "DCXG1256",
      "image": "https://img.kwcdn.com/product/open/03a66a4d7b8a43e4b6985a66f283d330-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 116,
      "sku": "YDGXC1847",
      "image": "https://img.kwcdn.com/product/open/d4b6580e4cf54142891533be40a5ec5b-goods.jpeg",
      "color": "黑色-M(1);",
      "total": 1
    },
    {
      "no": 117,
      "sku": "DCG801",
      "image": "https://img.kwcdn.com/product/open/e0a7d9ae2f5740c4a15603411d54e32c-goods.jpeg",
      "color": "白色-M(2);白色-L(1);",
      "total": 3
    },
    {
      "no": 118,
      "sku": "DCG1360",
      "image": "https://img.kwcdn.com/product/open/e3a27aaa44554f6db565c56cc7760d50-goods.jpeg",
      "color": "黑色-S(1);黑色-XL(1);黑色-XXL(1);",
      "total": 3
    },
    {
      "no": 119,
      "sku": "DCG1124",
      "image": "https://img.kwcdn.com/product/open/fbc65b22d9f74cdea7f1291e08beb8d5-goods.jpeg",
      "color": "白色-S(1);",
      "total": 1
    },
    {
      "no": 120,
      "sku": "LXCG735",
      "image": "https://img.kwcdn.com/product/open/d89bf6c7109e490687ecc7399a0949a6-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 121,
      "sku": "DFG450",
      "image": "https://img.kwcdn.com/product/open/d937f1f61dd649ffab2cd98e022c18cc-goods.jpeg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 122,
      "sku": "DFG450",
      "image": "https://img.kwcdn.com/product/open/d937f1f61dd649ffab2cd98e022c18cc-goods.jpeg",
      "color": "黑色-XXL(1);",
      "total": 1
    },
    {
      "no": 123,
      "sku": "DCG1399",
      "image": "https://img.kwcdn.com/product/fancy/7d3a1344-82b8-4c0f-8d68-f91570db0651.jpg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 124,
      "sku": "DCG968",
      "image": "https://img.kwcdn.com/product/open/47224eb02f964d7fb921c00248509d11-goods.jpeg",
      "color": "白色-M(1);白色-XXL(1);",
      "total": 2
    },
    {
      "no": 125,
      "sku": "DCG1418",
      "image": "https://img.kwcdn.com/product/open/062a494da3964169aac26d768f4de061-goods.jpeg",
      "color": "黑色-S(1);",
      "total": 1
    },
    {
      "no": 126,
      "sku": "YDF2690",
      "image": "https://img.kwcdn.com/product/open/483c28ba808c45a2b799df1e99501a3c-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 127,
      "sku": "YDF2690",
      "image": "https://img.kwcdn.com/product/open/483c28ba808c45a2b799df1e99501a3c-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 128,
      "sku": "DCG719",
      "image": "https://img.kwcdn.com/product/open/6e2f35f3b9704479ab6b7e223a1fe510-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 129,
      "sku": "DCG1353",
      "image": "https://img.kwcdn.com/product/open/a0f0420c9c1a404bb014e8ebe406a8e8-goods.jpeg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 130,
      "sku": "DJG047",
      "image": "https://img.kwcdn.com/product/fancy/a9addf43-2a41-4961-ae9c-ea73405a9d34.jpg",
      "color": "白色-S(1);",
      "total": 1
    },
    {
      "no": 131,
      "sku": "DCG1210",
      "image": "https://img.kwcdn.com/product/open/02ce31cb2ad94ac49f677d2a298cbe76-goods.jpeg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 132,
      "sku": "DCG317",
      "image": "https://img.kwcdn.com/product/open/e46730140cce414abcdab59e7261dabc-goods.jpeg",
      "color": "白色-S(1);",
      "total": 1
    },
    {
      "no": 133,
      "sku": "DCG735",
      "image": "https://img.kwcdn.com/product/fancy/81d9d90d-ce60-4b4a-968d-6eeccc587742.jpg",
      "color": "白色-L(1);",
      "total": 1
    },
    {
      "no": 134,
      "sku": "LXCG891",
      "image": "https://img.kwcdn.com/product/fancy/0a1be507-e92f-4d69-b8ca-1068e359846f.jpg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 135,
      "sku": "DFG347",
      "image": "https://img.kwcdn.com/product/open/f4a84a0a07a34e7e826b827876e6fc75-goods.jpeg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 136,
      "sku": "DCG639",
      "image": "https://img.kwcdn.com/product/fancy/bd4d5bc3-0671-4658-9986-80da1bc6ccb2.jpg",
      "color": "黑色-M(1);",
      "total": 1
    },
    {
      "no": 137,
      "sku": "LXCG781-1",
      "image": "https://img.kwcdn.com/product/fancy/07c75f8b-4aac-4ae6-84ad-24810c5e5519.jpg",
      "color": "黑色-L(1);",
      "total": 1
    },
    {
      "no": 138,
      "sku": "DCG1351",
      "image": "https://img.kwcdn.com/product/open/2c790c5db48140c88c7f7cf81a04ce0d-goods.jpeg",
      "color": "黑色-S(1);",
      "total": 1
    },
    {
      "no": 139,
      "sku": "DCG1351",
      "image": "https://img.kwcdn.com/product/open/2c790c5db48140c88c7f7cf81a04ce0d-goods.jpeg",
      "color": "黑色-M(1);",
      "total": 1
    },
    {
      "no": 140,
      "sku": "LXC362",
      "image": "https://img.kwcdn.com/product/fancy/c68674f6-38f5-4b6d-aec5-c6334777ac3c.jpg",
      "color": "白色-L(2);",
      "total": 2
    },
    {
      "no": 141,
      "sku": "DCG1222",
      "image": "https://img.kwcdn.com/product/open/8ee5df34f53248cdaa88933bde0b4a69-goods.jpeg",
      "color": "黑色-XL(1);黑色-XXL(1);",
      "total": 2
    },
    {
      "no": 142,
      "sku": "DCG1207",
      "image": "https://img.kwcdn.com/product/fancy/4b685203-f634-40e5-86c0-23b4cdb93461.jpg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 143,
      "sku": "YDGXC1034",
      "image": "https://img.kwcdn.com/product/fancy/73f2feb3-02d5-408b-b114-84b91d358396.jpg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 144,
      "sku": "DC243",
      "image": "https://img.kwcdn.com/product/fancy/aa0ca3ac-a3f3-4635-ae8c-0de2527a7432.jpg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 145,
      "sku": "DGXC2073",
      "image": "https://img.kwcdn.com/product/open/4217f64807d3440e9a4bbcd2411a27fc-goods.jpeg",
      "color": "黑色-XL(1);",
      "total": 1
    },
    {
      "no": 146,
      "sku": "DCG1445",
      "image": "https://img.kwcdn.com/product/open/2dd8e0244e094a3481a2648c62e06644-goods.jpeg",
      "color": "白色-M(1);",
      "total": 1
    },
    {
      "no": 147,
      "sku": "DJG054",
      "image": "https://img.kwcdn.com/product/fancy/b7d5c36d-83da-48a3-9e83-112c5bb18597.jpg",
      "color": "白色-S(1);",
      "total": 1
    },
    {
      "no": 148,
      "sku": "DCG1409",
      "image": "https://img.kwcdn.com/product/fancy/6e6edfaa-c44e-4867-a658-1ce281e9c115.jpg",
      "color": "白色-S(6);白色-M(3);",
      "total": 9
    }
  ];


  fetchImages(data)
    .then(async results => {
      // 创建Excel工作簿
      const name = "产品列表";
      const workbook = new ExcelJS.Workbook();
      const worksheet = workbook.addWorksheet(name);

      // 添加标题行, 列宽单位字符
      worksheet.columns = [
        { header: '编号', key: 'no', width: 10 },
        { header: 'SKU', key: 'sku', width: 20 },
        { header: '图片', key: 'image', width: 30 },
        { header: '颜色数量', key: 'color', width: 40 },
        { header: '总数量', key: 'total', width: 15 }
      ];
      worksheet.getRow(1).eachCell(cell => {
        cell.alignment = { vertical: 'middle', horizontal: 'center' };
      });
      // 添加数据行
      results.forEach(result => {
        console.log(`开始导出行：${result.item.no} - ${result.item.sku} - ${result.item.color} - ${result.item.total}`);
        const row = worksheet.addRow({
          no: result.item.no,
          sku: result.item.sku,
          color: result.item.color,
          total: result.item.total
        });
        // 设置行高 200 磅
        row.height = 200;
        // 设置该行所有单元格水平和垂直居中
        row.eachCell(cell => {
          cell.alignment = { vertical: 'middle', horizontal: 'center' };
        });
        // 插入图片到Excel
        if (result.imageData) {
          const imageId = workbook.addImage({
            buffer: result.imageData,
            extension: 'jpeg' // 根据实际图片类型调整
          });

          worksheet.addImage(imageId, {
            tl: { col: 2, row: row.number - 1 },
            br: { col: 3, row: row.number }
          });
        }
      });
      // 生成Excel文件
      const buffer = await workbook.xlsx.writeBuffer();
      const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
      const url = URL.createObjectURL(blob);

      const link = document.createElement('a');
      link.href = url;
      link.download = `${name}.xlsx`;
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);

      // 释放内存
      setTimeout(() => URL.revokeObjectURL(url), 100);
    })
    .catch(error => {
      console.error('Error in batch fetching:', error);
    });


  async function fetchImages(data) {
    // 创建所有fetch请求的Promise数组
    const fetchPromises = data.map(async (item) => {
      try {
        const imageData = await fetchImage(item.image);
        return { item, imageData, error: null };
      } catch (error) {
        console.error(`Failed to fetch image from ${item.image}:`, error);
        return { item, imageData: null, error };
      }
    });

    // 使用Promise.all等待所有请求完成
    return Promise.all(fetchPromises);
  }

  async function fetchImage(url) {
    return new Promise((resolve, reject) => {
      GM_xmlhttpRequest({
        method: 'GET',
        url: url,
        responseType: 'arraybuffer',
        onload: function (response) {
          resolve(response.response);
        },
        onerror: function (error) {
          reject(error);
        }
      });
    });
  }


})();